import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      redirect: '/login',
      component: ()=> import('../layout/Mainlayout.vue'),
      children:[
        {component: HomeView, path: '/home', name: 'home'},
        {component: ()=> import('../views/detail.vue'), path: '/detail', name: 'detail'},
        {component: ()=> import('../views/CollectionView.vue'), path: '/collection', name: 'collection'},
        {component: ()=> import('../views/CommentView.vue'), path: '/comment', name: 'comment'},
        {component: ()=> import('../views/VisualView.vue'), path: '/vis', name: 'vis'},
        {component: ()=> import('../views/RecView.vue'), path: '/rec', name: 'rec'},
      ]
    },
    {component: ()=> import('../views/LoginView.vue'), path: '/login', name: 'login'}


  ]
})

export default router
